Skip to content

codex: use camino for UTF-8 path assertions#220

Draft
hardfist wants to merge 2 commits into
mainfrom
codex/use-camino-utf8-path
Draft

codex: use camino for UTF-8 path assertions#220
hardfist wants to merge 2 commits into
mainfrom
codex/use-camino-utf8-path

Conversation

@hardfist
Copy link
Copy Markdown
Contributor

What changed

  • Adds camino and introduces path_to_utf8(&Path) -> &Utf8Path as the central UTF-8 path assertion helper.
  • Reworks internal UTF-8 path string access in resolver and tsconfig code to go through Utf8Path::as_str().
  • Keeps the public API on std::path for now, so this stacked PR avoids a breaking API migration.

Why

This builds on #219 by making the UTF-8-only path invariant explicit with a dedicated UTF-8 path type instead of ad hoc Path::to_str() assertions.

Scope

This is intentionally a low-risk first camino step. It does not migrate public PathBuf/Path API types, filesystem traits, errors, or option structs to Utf8PathBuf yet. Those can be handled in follow-up PRs if we want a full public API migration.

Validation

  • cargo fmt --all --check
  • cargo check --workspace
  • cargo clippy --all-features -- -D warnings
  • cargo test -p rspack_resolver --lib -- --skip pnp

Base automatically changed from codex/utf8-path-only to main May 18, 2026 04:43
@hardfist hardfist changed the title [codex] use camino for UTF-8 path assertions codex: use camino for UTF-8 path assertions May 18, 2026
@codspeed-hq
Copy link
Copy Markdown

codspeed-hq Bot commented May 18, 2026

Merging this PR will not alter performance

✅ 12 untouched benchmarks


Comparing codex/use-camino-utf8-path (ccc0343) with main (0616bdc)

Open in CodSpeed

@hardfist hardfist force-pushed the codex/use-camino-utf8-path branch from 9e93be2 to ccc0343 Compare May 18, 2026 04:53
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant